import { _decorator, Component, Node, Toggle } from 'cc';
const { ccclass, property } = _decorator;

/**放在在Toogle上，用来设置一些toggle选中时隐藏的东西 */
@ccclass('ToggleCheckedHideComps')
export class ToggleCheckedHideComps extends Component {
    @property([Node])
    nodes: Node[] = [];

    toggle: Toggle = null

    protected onLoad(): void {
        this.toggle = this.getComponent(Toggle)
    }
    update() {
        this.nodes.forEach(node => {
            node.active = !this.toggle.isChecked
        })
    }
}

